<?php

class Ajax extends CI_Controller{
	function __construct(){
		parent::__construct();
		$this->load->model('categories_m');
	}
	function addnew_categories(){
		
		$id = $this->categories_m->add_new();
		if($id == false){
			echo "0";
		}
		else{
			echo json_encode(array('id'=>$id,'category_name'=>$this->input->post('category')));
		}
		
	}
}// end class ajax